<template>
  <div>
    <hr />
    <h1>Home：{{ $store.state.counter }}</h1>
    <button @click="addTen">+10</button>
  </div>
</template>
<script>
import { INCREMENT_N } from "../store/mutation-types";
export default {
  methods: {
    addTen() {
      // this.$store.commit("incrementN", {n: 10});

      //另一种提交风格
      this.$store.commit({
        type: INCREMENT_N,
        n: 10,
        name: "ace",
      });
    },
  },
};
</script>
<style>
</style>
